package com.czl.base.data.bean.tengyun

import com.blankj.utilcode.util.TimeUtils

/**
 * @author by xubin,
 * @date on 2022/3/4.
 * PS: Not easy to write code, please indicate.
 */
data class TaskUserBean(
    var submitTname: String? = null,
    var companyName: String? = null,
    var companyShortName: String? = null,
    var processStatus: Int? = null,
    var taskType: Int? = null,
    var status: Int? = null,
    var nodeName: String? = null,
    var submitCompanyName: String? = null,
    var submitCompanyShortName: String? = null,
    var orgName: String? = null,
    var taskUserId: String? = null,
    var submitDate: Long? = null,
    var gmtUpdate: String? = null,
    var gmtCreate: String? = null,
    var tname: String? = null,
    var taskDesc: String? = null,
    var subheadName: String? = null,
    var subheadTitle: String? = null,
    var imageRes: Int? = null,
    var operationImageRes: Int? = null,
    var list: MutableList<TaskUserBean>? = null,
    var taskUserList: MutableList<TaskUserBean>? = null,
    var submitList:MutableList<TaskUserBean>? = null
) {

    fun getName(): String? {
        return if (tname == null) {
            submitTname
        } else {
            tname
        }
    }

    fun getDate(): String? {
        if (submitDate == null) {
            return null
        }
        return TimeUtils.date2String(TimeUtils.millis2Date(submitDate!!), "yyyy.MM.dd")
    }
    fun getStatusStr():String{
        if (status != null) {
            if(status == 1) {
                return "已同意"
            } else if(status == 2) {
                return "待审核"
            } else if(status == 3) {
                return "驳回"
            }
        }
        return ""
    }
}